package com.bpmn.flow.service;

import com.bpmn.common.pojo.PageResult;
import com.bpmn.flow.controller.query.DefinitionQuery;
import com.bpmn.flow.controller.vo.ProcessDefinitionVo;
import org.flowable.engine.repository.ProcessDefinition;

import java.util.List;
import java.util.Set;

/**
 * @author rain
 */
public interface DefinitionService {

    PageResult<ProcessDefinitionVo> getFlowDefinitions(DefinitionQuery definitionQuery);

    boolean updateDefinitionState(String processDefinitionId);

    String definitionXml(String processDefinitionId);

    ProcessDefinition getProcessDefinitionByDeploymentId(String deploymentId);

    void suspendOldVersionProcessDefinition(String deploymentId);

    /**
     * 通过流程定义key挂起流程定义
     */
    void suspendProcessDefinitionByKey(String processDefinitionKey);

    /**
     * 获得 deploymentIds 对应的 ProcessDefinition 数组
     *
     * @param deploymentIds 部署编号的数组
     * @return 流程定义的数组
     */
    List<ProcessDefinition> getProcessDefinitionListByDeploymentIds(Set<String> deploymentIds);

}
